package y24.m1.homework;
import javax.swing.*;
import java.awt.*;
import java.util.*;
import java.util.List;

public class Test10 {
    public static void main(String[] args) {
        new Drawing();
    }
    static class Drawing extends JFrame{
        private MyPanel mp=null;
        public Drawing() {
            mp = new MyPanel();
            Scanner scanner = new Scanner(System.in);
            this.add(mp);
            this.setSize(700,800);
            this.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
            this.setVisible(true);
        }
    }
    static class MyPanel extends JPanel {
        @Override
        public void paint(Graphics g) {
            super.paint(g);
            g.setColor(Color.red);
            g.setFont(new Font("隶书",Font.BOLD,30));
            g.drawString("股票有风险，投资需谨慎",250,30);
            g.setColor(Color.black);
            g.setFont(new Font("隶书",Font.BOLD,30));
            g.drawString("投注数量：" + 10,10,40);
            for (int i = 1; i < 10; i++) {
                for (int j = 1; j < 8; j++) {
                    int x = new Random().nextInt(100);
                    if (j < 6){
                        g.setColor(Color.RED);
                        g.fillOval(j * 70,i * 70+30,50,50);
                    }else {
                        g.setColor(Color.blue);
                        g.fillOval(j * 70,i * 70+30,50,50);
                    }
                    g.setColor(Color.white);
                    g.setFont(new Font("隶书",Font.BOLD,30));
                    g.drawString(String.valueOf(x),j * 70+12,i * 70+63);
                }
            }
        }
    }
}